{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "#  mplfinance: customization and styles\n",
    "\n",
    "---"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# This allows multiple outputs from a single jupyter notebook cell:\n",
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = \"all\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Read in daily data for the S&P 500 from November of 2019 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(20, 5)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "      <td>510301237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3085.20</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "      <td>524848878</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               Open     High      Low    Close     Volume\n",
       "Date                                                     \n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91  510301237\n",
       "2019-11-04  3078.96  3085.20  3074.87  3078.27  524848878"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-27</th>\n",
       "      <td>3145.49</td>\n",
       "      <td>3154.26</td>\n",
       "      <td>3143.41</td>\n",
       "      <td>3153.63</td>\n",
       "      <td>421853938</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-29</th>\n",
       "      <td>3147.18</td>\n",
       "      <td>3150.30</td>\n",
       "      <td>3139.34</td>\n",
       "      <td>3140.98</td>\n",
       "      <td>286602291</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               Open     High      Low    Close     Volume\n",
       "Date                                                     \n",
       "2019-11-27  3145.49  3154.26  3143.41  3153.63  421853938\n",
       "2019-11-29  3147.18  3150.30  3139.34  3140.98  286602291"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily = pd.read_csv('../../data/SP500_NOV2019_Hist.csv',index_col=0,parse_dates=True)\n",
    "daily.index.name = 'Date'\n",
    "daily.shape\n",
    "daily.head(2)\n",
    "daily.tail(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['open', 'high', 'low', 'close', 'volume'], dtype='object')"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily.columns.str.lower()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(daily.columns.str.lower().values).count('open')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['Open', 'High', 'Low', 'Close', 'Volume'], dtype='object')"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "tempindex = pd.Index(daily.columns.str.lower())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['open', 'high', 'low', 'close', 'volume'], dtype='object')"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tempindex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "ixlow = tempindex.get_loc('low')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([3050.72, 3074.87, 3072.15, 3065.89, 3080.23, 3073.58, 3075.82,\n",
       "       3084.73, 3078.8 , 3083.26, 3104.6 , 3112.06, 3113.47, 3091.41,\n",
       "       3094.55, 3099.26, 3117.44, 3131.  , 3143.41, 3139.34])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily.iloc[:,ixlow].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "saveindex = pd.Index(daily.columns)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['Open', 'High', 'Low', 'Close', 'Volume'], dtype='object')"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "saveindex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "daily.columns = daily.columns.str.lower()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "      <td>510301237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3085.20</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "      <td>524848878</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-05</th>\n",
       "      <td>3080.80</td>\n",
       "      <td>3083.95</td>\n",
       "      <td>3072.15</td>\n",
       "      <td>3074.62</td>\n",
       "      <td>585634570</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-06</th>\n",
       "      <td>3075.10</td>\n",
       "      <td>3078.34</td>\n",
       "      <td>3065.89</td>\n",
       "      <td>3076.78</td>\n",
       "      <td>544288522</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-07</th>\n",
       "      <td>3087.02</td>\n",
       "      <td>3097.77</td>\n",
       "      <td>3080.23</td>\n",
       "      <td>3085.18</td>\n",
       "      <td>566117910</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               open     high      low    close     volume\n",
       "Date                                                     \n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91  510301237\n",
       "2019-11-04  3078.96  3085.20  3074.87  3078.27  524848878\n",
       "2019-11-05  3080.80  3083.95  3072.15  3074.62  585634570\n",
       "2019-11-06  3075.10  3078.34  3065.89  3076.78  544288522\n",
       "2019-11-07  3087.02  3097.77  3080.23  3085.18  566117910"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['Open', 'High', 'Low', 'Close', 'Volume'], dtype='object')"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "saveindex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "daily.columns = pd.Index(['Open', 'open', 'oPEN', 'OPEN', 'Volume'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>open</th>\n",
       "      <th>oPEN</th>\n",
       "      <th>OPEN</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "      <td>510301237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3085.20</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "      <td>524848878</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-05</th>\n",
       "      <td>3080.80</td>\n",
       "      <td>3083.95</td>\n",
       "      <td>3072.15</td>\n",
       "      <td>3074.62</td>\n",
       "      <td>585634570</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-06</th>\n",
       "      <td>3075.10</td>\n",
       "      <td>3078.34</td>\n",
       "      <td>3065.89</td>\n",
       "      <td>3076.78</td>\n",
       "      <td>544288522</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-07</th>\n",
       "      <td>3087.02</td>\n",
       "      <td>3097.77</td>\n",
       "      <td>3080.23</td>\n",
       "      <td>3085.18</td>\n",
       "      <td>566117910</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               Open     open     oPEN     OPEN     Volume\n",
       "Date                                                     \n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91  510301237\n",
       "2019-11-04  3078.96  3085.20  3074.87  3078.27  524848878\n",
       "2019-11-05  3080.80  3083.95  3072.15  3074.62  585634570\n",
       "2019-11-06  3075.10  3078.34  3065.89  3076.78  544288522\n",
       "2019-11-07  3087.02  3097.77  3080.23  3085.18  566117910"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Date\n",
       "2019-11-01    3066.91\n",
       "2019-11-04    3078.27\n",
       "2019-11-05    3074.62\n",
       "2019-11-06    3076.78\n",
       "2019-11-07    3085.18\n",
       "Name: OPEN, dtype: float64"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily['OPEN'].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "daily.columns = daily.columns.str.lower()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>open</th>\n",
       "      <th>open</th>\n",
       "      <th>open</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3085.20</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-05</th>\n",
       "      <td>3080.80</td>\n",
       "      <td>3083.95</td>\n",
       "      <td>3072.15</td>\n",
       "      <td>3074.62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-06</th>\n",
       "      <td>3075.10</td>\n",
       "      <td>3078.34</td>\n",
       "      <td>3065.89</td>\n",
       "      <td>3076.78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-07</th>\n",
       "      <td>3087.02</td>\n",
       "      <td>3097.77</td>\n",
       "      <td>3080.23</td>\n",
       "      <td>3085.18</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               open     open     open     open\n",
       "Date                                          \n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91\n",
       "2019-11-04  3078.96  3085.20  3074.87  3078.27\n",
       "2019-11-05  3080.80  3083.95  3072.15  3074.62\n",
       "2019-11-06  3075.10  3078.34  3065.89  3076.78\n",
       "2019-11-07  3087.02  3097.77  3080.23  3085.18"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily['open'].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "daily.columns = ['x.Open','x.High','x.Low','x.Close','x.Volume']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x.Open</th>\n",
       "      <th>x.High</th>\n",
       "      <th>x.Low</th>\n",
       "      <th>x.Close</th>\n",
       "      <th>x.Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "      <td>510301237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3085.20</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "      <td>524848878</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-05</th>\n",
       "      <td>3080.80</td>\n",
       "      <td>3083.95</td>\n",
       "      <td>3072.15</td>\n",
       "      <td>3074.62</td>\n",
       "      <td>585634570</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-06</th>\n",
       "      <td>3075.10</td>\n",
       "      <td>3078.34</td>\n",
       "      <td>3065.89</td>\n",
       "      <td>3076.78</td>\n",
       "      <td>544288522</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-07</th>\n",
       "      <td>3087.02</td>\n",
       "      <td>3097.77</td>\n",
       "      <td>3080.23</td>\n",
       "      <td>3085.18</td>\n",
       "      <td>566117910</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             x.Open   x.High    x.Low  x.Close   x.Volume\n",
       "Date                                                     \n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91  510301237\n",
       "2019-11-04  3078.96  3085.20  3074.87  3078.27  524848878\n",
       "2019-11-05  3080.80  3083.95  3072.15  3074.62  585634570\n",
       "2019-11-06  3075.10  3078.34  3065.89  3076.78  544288522\n",
       "2019-11-07  3087.02  3097.77  3080.23  3085.18  566117910"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "import mplfinance as mpf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['x.Open', 'x.High', 'x.Low', 'x.Close', 'x.Volume']"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(daily.columns.values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAdIAAAFXCAYAAAAWHc9dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3deXhV1b3G8e/aSU5GMjAkYEgYRUCLVUFAVCpUCUi1Ti2gQrl6LU7XUsSBFpVardWiViWt1qug4FiwDkyiONQBkEEpKiJhEIkSMpF5ONnr/hGIcJkSzpjk/TwPD+RM+e0fJ3nP2nuvtY211iIiIiLHxAl1ASIiIs2ZglRERMQHClIREREfKEhFRER8oCAVERHxQWSoCwik2NhYampqaNOmTahLERGRZqq0tBSPx0NlZeUh72/RQVpTU4PrurhueMzwMcag2UaBod4GlvobWOpv4Pijt67rUlNTc9j7W3SQtmnTBte1rPtie6hLASA9NYGdeWWhLqNFUm8DS/0NLPU3cPzR21P6dsFxzGHv1zFSERERHyhIRUREfKAgFRER8YGCVERExAcKUhERER8oSEVERHygIBUREfGBglRERMQHClIREREfKEhFRER8oCAVERHxgYJURET8pmdGCj0zUkJdRlC16EXrRUQkNA4Xppt3FAW5ksDTiFRERMQHGpGKiIjftcSR5+FoRCoiIuIDBamIiIgPFKQiIiI+UJCKiIj4QEEqIiLiAwWpiIiIDxSkIiISdprTCkkKUhERER8oSEVERHygIBUREfGBglRERMQHClIREREfKEhFRER8oKu/iIhIyDSXKS5HohGpiIiID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CQkJ5OfnAzB27Fg8Hg+FhYX6vRCGtGs3hGJjY+nSpQtDhw4lJSWFb775hjVr1pCYmNhwzLS0tJTo6OhQl9oseb1enn32WXbv3s3XX3/N9OnTOe+880hNTWXTpk18++23nHbaaTiOoxFqE0VHR5Oens66det47733+Pzzz3n00Ue56KKLOPHEE9mxYwd5eXmceuqpgE6WaSzXdTHGEBERQUREBCeddBJRUVG4rssrr7zCueeeS2JiIsYYysvLNToNE9q1G2QPPfQQu3bt4rjjjmPgwIEMHDgQgJNOOgnHcViwYAH//Oc/6dChA9u3b+ezzz7jxhtvJCoqKsSVNw/7+tupUydGjhzJrFmzWLRoEevXr2fIkCFMnjwZgAULFvDmm2/qF1ETffzxxwwePBiAHj16cNlll/H3v/+dXr16ERcXR11dHT179qRz586sXr0ax9FOr8b685//zHfffUf79u254IILuOyyy4D6D4RFRUXU1tY2hOjChQvZvHkz1113nX43hAG9y4Po9ttvJycnh8GDB1NXV8e0adN44YUXGu7v27cvF198MV26dGHy5Mncc889XHDBBfpBaaT9++u6LpMmTeKzzz7j2muvZfjw4SQm/rDmcmRkJNZaysvLQ1hx8/LYY48xceJEnnjiiYbb+vbty80338yll15KfHw8ERERQP1u9bi4OGpqakJVbrNy++238+2335KVlYXjODz55JPs2rULqF8zPDIyEo/HQ2JiIq+++iqPPPIIo0eP1u+GMKERaZDs2rWL/Px8/vGPfwBQU1NDnz59mDp1Kq7rMm7cOKD+F9PSpUspLy/niSeeoGfPnqEsu9k4VH979+7NLbfcQk1NDaeddhrTp09vGDUtX76chx56iPj4+BBX3ny4rsuECRN44403qK2t5frrrwcgMzMTgO3bt7Ns2TKKiopYvnw5Dz/8sEb8jbBz505yc3OZM2cOAOnp6dx9991UVlYC9bvFk5KSSEtL4w9/+AOffPIJjz76KD169Ahl2bIfjUiDJCUlhdLS0oYzSD0eD1lZWTz44INkZ2fz1ltvAbB27VpWrlzJ3/72N4VoExyqvyNHjmTmzJk8+OCDVFZW8vjjj1NWVkZVVRWPPvooJ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jqb+Cot62PglRERMQHmtAkIiLiAwWpiIiIDxSkIiIiPlCQioiI+EBBKiIi4gMFqYiIiA8UpCIiIj5QkIqIiPjg/wAFJCY0FxEdnQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 576x414 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "mpf.plot(daily,columns=list(daily.columns.values),mav=3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x.Open</th>\n",
       "      <th>x.High</th>\n",
       "      <th>x.Low</th>\n",
       "      <th>x.Close</th>\n",
       "      <th>x.Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "      <td>510301237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3085.20</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "      <td>524848878</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-05</th>\n",
       "      <td>3080.80</td>\n",
       "      <td>3083.95</td>\n",
       "      <td>3072.15</td>\n",
       "      <td>3074.62</td>\n",
       "      <td>585634570</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             x.Open   x.High    x.Low  x.Close   x.Volume\n",
       "Date                                                     \n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91  510301237\n",
       "2019-11-04  3078.96  3085.20  3074.87  3078.27  524848878\n",
       "2019-11-05  3080.80  3083.95  3072.15  3074.62  585634570"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily.head(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame(daily.iloc[0:,0:])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.columns = ['open','high','low','close','volume']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "      <td>510301237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3085.20</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "      <td>524848878</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-05</th>\n",
       "      <td>3080.80</td>\n",
       "      <td>3083.95</td>\n",
       "      <td>3072.15</td>\n",
       "      <td>3074.62</td>\n",
       "      <td>585634570</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               open     high      low    close     volume\n",
       "Date                                                     \n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91  510301237\n",
       "2019-11-04  3078.96  3085.20  3074.87  3078.27  524848878\n",
       "2019-11-05  3080.80  3083.95  3072.15  3074.62  585634570"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x.Open</th>\n",
       "      <th>x.High</th>\n",
       "      <th>x.Low</th>\n",
       "      <th>x.Close</th>\n",
       "      <th>x.Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "      <td>510301237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3085.20</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "      <td>524848878</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-05</th>\n",
       "      <td>3080.80</td>\n",
       "      <td>3083.95</td>\n",
       "      <td>3072.15</td>\n",
       "      <td>3074.62</td>\n",
       "      <td>585634570</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             x.Open   x.High    x.Low  x.Close   x.Volume\n",
       "Date                                                     \n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91  510301237\n",
       "2019-11-04  3078.96  3085.20  3074.87  3078.27  524848878\n",
       "2019-11-05  3080.80  3083.95  3072.15  3074.62  585634570"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily.head(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.loc['2019-11-04','high'] = 3000.00"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "      <td>510301237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3000.00</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "      <td>524848878</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-05</th>\n",
       "      <td>3080.80</td>\n",
       "      <td>3083.95</td>\n",
       "      <td>3072.15</td>\n",
       "      <td>3074.62</td>\n",
       "      <td>585634570</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               open     high      low    close     volume\n",
       "Date                                                     \n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91  510301237\n",
       "2019-11-04  3078.96  3000.00  3074.87  3078.27  524848878\n",
       "2019-11-05  3080.80  3083.95  3072.15  3074.62  585634570"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x.Open</th>\n",
       "      <th>x.High</th>\n",
       "      <th>x.Low</th>\n",
       "      <th>x.Close</th>\n",
       "      <th>x.Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "      <td>510301237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3085.20</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "      <td>524848878</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-05</th>\n",
       "      <td>3080.80</td>\n",
       "      <td>3083.95</td>\n",
       "      <td>3072.15</td>\n",
       "      <td>3074.62</td>\n",
       "      <td>585634570</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             x.Open   x.High    x.Low  x.Close   x.Volume\n",
       "Date                                                     \n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91  510301237\n",
       "2019-11-04  3078.96  3085.20  3074.87  3078.27  524848878\n",
       "2019-11-05  3080.80  3083.95  3072.15  3074.62  585634570"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily.head(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "o = daily['x.Open'].values\n",
    "h = daily['x.High'].values\n",
    "l = daily['x.Low'].values\n",
    "c = daily['x.Close'].values\n",
    "v = daily['x.Volume'].values\n",
    "d = daily.index.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "df2 = pd.DataFrame({'open':o,'high':h,'low':l,'close':c},index=pd.DatetimeIndex(d))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3085.20</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-05</th>\n",
       "      <td>3080.80</td>\n",
       "      <td>3083.95</td>\n",
       "      <td>3072.15</td>\n",
       "      <td>3074.62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-06</th>\n",
       "      <td>3075.10</td>\n",
       "      <td>3078.34</td>\n",
       "      <td>3065.89</td>\n",
       "      <td>3076.78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-07</th>\n",
       "      <td>3087.02</td>\n",
       "      <td>3097.77</td>\n",
       "      <td>3080.23</td>\n",
       "      <td>3085.18</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               open     high      low    close\n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91\n",
       "2019-11-04  3078.96  3085.20  3074.87  3078.27\n",
       "2019-11-05  3080.80  3083.95  3072.15  3074.62\n",
       "2019-11-06  3075.10  3078.34  3065.89  3076.78\n",
       "2019-11-07  3087.02  3097.77  3080.23  3085.18"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "open    3087.02\n",
       "Name: 2019-11-07 00:00:00, dtype: float64"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "3087.02"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "open     3087.02\n",
       "close    3085.18\n",
       "Name: 2019-11-07 00:00:00, dtype: float64"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "3086.1"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2.loc['2019-11-07',['open',]]\n",
    "df2.loc['2019-11-07',['open',]].mean()\n",
    "df2.loc['2019-11-07',['open','close']]\n",
    "df2.loc['2019-11-07',['open','close']].mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
